package com.supermap.originTest2;


import com.supermap.License;
import com.supermap.data.*;
import com.supermap.data.conversion.*;
import com.supermap.data.processing.CacheWriter;


public class Q140711 {

    /**
     * 程序入口点
     * The entrance of the programme.
     */
    public static void main(String[] args) {

		CacheWriter cw = new CacheWriter();
//		cw.FromConfigFile(sciFile);
//		cw.setOutputFolder(new File(sciFile).getParentFile().getParent());
		String filePath = "E:\\MapData\\新建文件地理数据库.gdb";

		//

		License license = new License();
		System.out.println(license.verify());
		System.out.println(license.connect(65400));
		System.out.println(license.connect(23400));

		Workspace m_workspace = new Workspace();
		WorkspaceConnectionInfo conInfo = new WorkspaceConnectionInfo(
				"E:\\\\MapData\\\\202403\\\\Workspace.smwu");
		conInfo.setType(WorkspaceType.SMWU);
		m_workspace.open(conInfo);

		Datasource datasource =m_workspace.getDatasources().get(0);






		ImportSettingFileGDBVector gdbVector = new ImportSettingFileGDBVector(filePath, datasource);
		gdbVector.setEnableMultiThread(true);
		gdbVector.setImportMode(ImportMode.OVERWRITE);
		gdbVector.setSourceFileCharset(Charset.UTF8);
		PrjCoordSys prjCoordSys = PrjCoordSys.fromEPSG(4326);
		gdbVector.setTargetPrjCoordSys(prjCoordSys);

		ImportDataInfos targetDataInfos = gdbVector.getTargetDataInfos("", EncodeType.NONE, prjCoordSys);
		gdbVector.setTargetDataInfos(targetDataInfos);

		DataImport dataImport = new DataImport();
		dataImport.getImportSettings().add(gdbVector);
		ImportResult run = dataImport.run();
		System.out.println(0);




	}


}  

